package list;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;
import android.widget.ListView;

import com.popupwindowdemo.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/7/19/019.
 */

public class ListMainActivity extends AppCompatActivity {

    ListView LvJBFX;
    private AdapterByJBFX mAdapter;
    private List<String> list = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.list_main);


        LvJBFX = (ListView) findViewById(R.id.lv_jbfx);
        geneItems(10);
        mAdapter = new AdapterByJBFX(getApplicationContext(), list);
        LvJBFX.setAdapter(mAdapter);

    }

    private void geneItems(int sumListItem) {
        list.clear();
        for (int i = 0; i < sumListItem; i++) {
            list.add("item" + i);
        }
    }

}